﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Tetris
{
    public class TPiece : Piece
    {
        public TPiece()
            : base(new List<Square> { new Square(3, 1), new Square(4, 1, true), new Square(4, 2), new Square(5, 1) })
        {
            SetColors();
        }

        public override void SetPieceLocationsForGrid()
        {
            squares[0].gridX = 3;
            squares[0].gridY = 1;

            squares[1].gridX = 4;
            squares[1].gridY = 1;

            squares[2].gridX = 4;
            squares[2].gridY = 2;

            squares[3].gridX = 5;
            squares[3].gridY = 1;
        }

        public override void SetPieceLocationsForHoldPiece()
        {
            squares[0].gridX = 1;
            squares[0].gridY = 1;

            squares[1].gridX = 2;
            squares[1].gridY = 1;

            squares[2].gridX = 2;
            squares[2].gridY = 2;

            squares[3].gridX = 3;
            squares[3].gridY = 1;
        }

        public override void SetColors()
        {
            foreach (Square square in squares)
            {
                square.Color = Color.White;
                square.backgroundString = "Images/yellow_block";
            }
            //squares[0].Color = Color.Yellow;
            //squares[1].Color = Color.Yellow;
            //squares[2].Color = Color.Yellow;
            //squares[3].Color = Color.Yellow;
        }
    }
}
